import ajax from '../util/request'
// 获取商品列表
export const getGoodsAjax = (params) => ajax({
    method:'get',
    url:"/goods",
    params,
    headtype:'form'
})

// 添加商品
export const setGoods = (params) => ajax({
    method:'post',
    url:"/goods",
    params,
    headtype:'form'
})
// 删除商品
export const delGoods = (id) => ajax({
    method:'delete',
    url:"/goods/"+id,
    params:{},
    headtype:'form'
})
//id查询商品
export const selGoods = (id) => ajax({
    method:'get',
    url:"/goods/"+id,
    params:{},
    headtype:'form'
})

// 修改商品
export const resetGoods = (id,params) => ajax({
    method:'put',
    url:"/goods/"+id,
    params,
    headtype:'form'
})